.TH qthread_readFE 3 "APRIL 2011" libqthread "libqthread"
.SH NAME
.B qthread_readFE
\- waits for the source to be full, then copies and empties it
.SH SYNOPSIS
.B #include <qthread.h>

.I int
.br
.B qthread_readFE
.RI "(aligned_t *" dest ", const aligned_t *" src );
.SH DESCRIPTION
This function waits for memory to become full, and then empties it. When memory
becomes full, only one thread blocked like this will be awoken. Data is read
from
.I src
and stored in
.IR dest .
.PP
The semantics of readFE are:
.RS
.PP
1 -
.IR src 's
FEB state must be "full"
.br
2 - data is copied from
.I src
to
.I dest
.br
3 -
.IR src 's
FEB state gets changed from "full" to "empty"
.RE
.SH WARNING
This, and all other FEB-related functions currently operate exclusively on
aligned data. This is to simulate the behavior of the XMT as closely as
possible. The library requires 4- or 8-byte alignment, depending on whether
compiled in 32-bit or 64-bit mode.
.SH RETURN VALUE
On success, the memory address
.I src
is marked empty, the memory address
.I dest
is filled with the contents of
.I src
and 0 is returned. On error, a non-zero error code is returned.
.SH ERRORS
.TP 12
.B ENOMEM
Not enough memory could be allocated for bookkeeping structures.
.SH SEE ALSO
.BR qthread_empty (3),
.BR qthread_fill (3),
.BR qthread_writeEF (3),
.BR qthread_writeF (3),
.BR qthread_readFF (3),
.BR qthread_lock (3),
.BR qthread_unlock (3)
